#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>

using namespace std;

bool Judgeleapyear(int year){
    //是否是世纪年
    if(year % 100 == 0){//是世纪年
        //是否是闰年
        if(year % 400 == 0){//是闰年
            return true;
        }
        else{//非闰年
            return false;
        }
    }
    else{//非世纪年
        //是否是闰年
        if(year % 4 == 0){//是闰年
            return true;
        }
        else{//非闰年
            return false;
        }
    }
}

map<int, int> dic{
    {1, 31}, 
    {2, 60},
    {3, 91},
    {4, 121},
    {5, 152},
    {6, 182},
    {7, 213},
    {8, 244},
    {9, 274},
    {10, 305}, 
    {11, 335}, 
    {12, 366},     
};

map<int, int> dic1{
    {1, 31}, 
    {2, 59},
    {3, 90},
    {4, 120},
    {5, 151},
    {6, 181},
    {7, 212},
    {8, 243},
    {9, 273},
    {10, 304}, 
    {11, 334}, 
    {12, 365},      
};

int dayOfYear(int y, int m, int d){
    int result;
    if(Judgeleapyear(y) == true){
        result = dic[m-1] + d;
    }
    else{
        result = dic1[m-1] + d;
    }

    return result;
}

int main(int argc, char const *argv[])
{
    cout << dayOfYear(1900, 3, 1) << endl;
    return 0;
}
